Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip REF: redirect df.to_html to Styler if new kwargs are used. #45090

Closed
wants to merge 30 commits into from

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Dec 28, 2021

This is an alternatative way of transitioning DataFrame.to_html to Styler.to_html.

It is a very minimalist introduction:

  • It will fallback to the original HTMLFormatter implementation if:
    • any of the deprecated kwargs are specifically input, and will show a deprecation warning.
    • none of the new Styler implementation kwargs are input.
  • It will only use the new Styler implementation if no deprecated kwargs are input and at least one new kwarg is used.

here is the rendered doc-strings:
Screenshot 2022-01-02 at 15 46 11
Screenshot 2022-01-02 at 15 46 23
Screenshot 2022-01-02 at 15 46 34
Screenshot 2022-01-02 at 15 46 45
Screenshot 2022-01-02 at 15 46 56
Screenshot 2022-01-02 at 15 47 07
Screenshot 2022-01-02 at 15 47 17
Screenshot 2022-01-02 at 15 47 25
Screenshot 2022-01-02 at 15 47 32

@@ -2865,16 +2865,29 @@ def to_html(
justify: str | None = None,
max_rows: int | None = None,
max_cols: int | None = None,
show_dimensions: bool | str = False,
show_dimensions: bool | str | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont' you want these as lib.no_default? (e.g. to see if the user passed them)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, I've not really used lib.no_default before and a previous suggestion was to use None. Happy to investigate and switch if preferred.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None is fine to use for this purpose, as long as it is not a valid value for the keyword

encoding: str | None = None,
*,
table_attributes: str | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you adding the new options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@attack68 attack68 marked this pull request as ready for review January 2, 2022 15:46
@attack68 attack68 marked this pull request as draft January 11, 2022 06:20
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Feb 12, 2022
@datapythonista
Copy link
Member

@attack68 do you still want to work on this?

@attack68
Copy link
Contributor Author

@datapythonista I do but it requires some pre requisites and a community consensus. There is a bit more progress on DataFrame.to_latex. Hopefully in future will try to use that as a template, so will close this for now.

@attack68 attack68 closed this Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants